import 'package:flutter/material.dart';
import 'package:fluro/fluro.dart';
import 'package:flutter/services.dart';
import 'package:flutter_downloader/flutter_downloader.dart';
import 'package:hm_show_flutter/config/app_build.dart';
import 'package:hm_show_flutter/config/routers.dart';
import 'package:hm_show_flutter/config/application.dart';
import 'package:fluwx/fluwx.dart' as fluwx;

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  // 强制竖屏
  SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitUp,
    DeviceOrientation.portraitDown
  ]).then((result){
    runApp(MyApp());
  });

}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  MyApp() {
    final router = Router();
    Routers.configureRoutes(router);
    Application.router = router;
    FlutterDownloader.initialize();
    fluwx.registerWxApi(appId:AppBuild.wx_app_id,universalLink:AppBuild.wx_universal_Link);
  }
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      onGenerateRoute: Application.router.generator,
      theme: ThemeData(
        primaryColor: Colors.blue[400],
      ),
    );
  }
}
